RippleMidiManager{

	classvar inPorts, outPorts;


	
	*init{
	

		
		inPorts = 10;
		outPorts = 10;
		MIDIClient.init(inPorts,outPorts);					// explicitly intialize the client
		inPorts.do({ arg i; 
			MIDIIn.connect(i, MIDIClient.sources.at(i));
		});
		
		MIDIIn.noteOn = { 
			arg src, chan, num, vel; 
			Ripple.getVoicesByMidiChannel(chan + 1).do{|voice|
				voice.playSound(volume: vel / 128, pitchRatio: (num - SynthConstants.baseMidi).midiratio);
			
			};
			
		};
		MIDIIn.noteOff = { 
			arg src, chan, num, vel;
			Ripple.getVoicesByMidiChannel(chan + 1).do{|voice|
				voice.releaseSound;
			};
			
		};
		
		
		MIDIIn.control = { 
			arg src, chan, num, val; 	
			
		};
		
		
		
		MIDIIn.polytouch = { arg src, chan, num, vel; 	[chan,num,vel / 127]; };
		MIDIIn.program = { arg src, chan, prog; 		[chan,prog]; };
		MIDIIn.touch = { arg src, chan, pressure; 	[chan,pressure]; };
		MIDIIn.bend = { arg src, chan, bend; 			[chan,bend - 8192]; };
		MIDIIn.sysex = { arg src, sysex; 			sysex; };
		MIDIIn.sysrt = { arg src, chan, val; 			[chan,val]; };
		MIDIIn.smpte = { arg src, chan, val; 			[chan,val]; };
	
	}
	
	*midiAction{
	
	}


}
